package linkList1;

public class Test {
    public static void main(String[] args) {
        MyLinkList link=new MyLinkList();
        //头插法
        link.addFirst(4);
        link.addFirst(4);
        link.addFirst(3);
        link.addFirst(3);
        link.addFirst(2);
        link.addFirst(2);
        link.addFirst(1);
        link.addFirst(1);

        //link.display();
        //System.out.println("-------------------");
        //尾插法
        link.addLast(5);
        link.addLast(5);
        link.addLast(6);
        link.addLast(6);
        link.addLast(4);

        link.addLast(7);
        link.addLast(7);
        link.display();

        System.out.println("---------------------------");
//        //任意位置插入
//        link.addIndex(2,22);
//        link.addIndex(7,77);
//        link.addIndex(0,100);
//        link.addIndex(10,1);

//        link.remove(1);
//        link.remove(7);
//        link.remove(155);
//        link.remove(4);
//        link.remove(2);
//        link.remove(155);
//        link.remove(6545);
        ///link.clear();

//        link.remove(1);
//        link.remove(3);
//        link.remove(7);
        link.removeAllKey(1);
        link.removeAllKey(1);

        link.removeAllKey(3);
        link.removeAllKey(7);
        link.removeAllKey(4);



        link.display();

        //System.out.println(link.contains(104));

        //System.out.println(link.size());


    }
}
